<@override name="title">
    <#if oper=="create">
    新建游戏规则
    <#else>
    编辑游戏规则
    </#if>
</@override>

<@override name="viewbody">
<div class="row">
    <div class="col-md-12">
        <h3 class="page-title">
            游戏管理
            <small>
                <#if oper=="create">
                    创建新的游戏规则
                <#else>
                    修改已有游戏规则
                </#if>
            </small>
        </h3>
        <ul class="page-breadcrumb breadcrumb">
            <li>
                <i class="fa fa-home"></i>
                <a href="${ctx}/admin/home">
                    首页
                </a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="${ctx}/admin/game/rule">
                    游戏规则
                </a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="#">
                    <#if oper=="create">
                        新建游戏规则
                    <#else>
                        编辑游戏规则
                    </#if>
                </a>
            </li>
        </ul>
    </div>
</div>

<form class="form-horizontal" action="${ctx}/admin/game/rule/save" role="form" id="dataForm" method="post">
    <div class="panel panel-default">
        <div class="panel-heading"><h6 class="panel-title">游戏规则信息</h6></div>
        <div class="panel-body">
            <input name="rule.id" type="hidden" value="${rule.id!}"/>

            <div class="form-group">
                <label class="col-sm-2 control-label">中奖概率: <span class="mandatory">*</span></label>

                <div class="row">
                    <div class="col-md-2">
                        <input type="text" class="form-control" name="rule.winning" id="rule.winning" value="${rule.winning!}">
                    </div>
                    <div class="col-md-1 text-center input-inline" style="line-height: 30px;">
                        /
                    </div>
                    <div class="col-md-2">
                        <input type="text" class="form-control" name="rule.total" id="rule.total" value="${rule.total!}">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="rule.description">描述: </label>

                <div class="col-sm-9">
                    <textarea class="form-control" rows="3" name="rule.description" id="rule.description">${rule.description!}</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="rule.free_times">每日免费: <span class="mandatory">*</span></label>

                <div class="col-sm-9">
                    <div class="input-group input-medium">
                        <input type="text" class="form-control" name="rule.free_times" id="rule.free_times" value="${rule.free_times!}">
                        <span class="input-group-addon">
                            次
                        </span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="ruleIntegral">消耗积分: </label>

                <div class="col-sm-9">
                    <div class="input-group input-medium">
                        <div class="input-group">
                            <span class="input-group-addon">
                                <input type="checkbox" name="rule.consume" id="ruleConsume" value="1" <#if rule.consume??>${rule.consume?string('checked', '')}</#if>>
                            </span>
                            <input type="text" class="form-control" name="rule.integral" id="ruleIntegral" value="${rule.integral!}">
                            <span class="input-group-addon">
                                分
                            </span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="ruleVirtualCurrency">消耗虚拟货币: </label>

                <div class="col-sm-9">
                    <div class="input-group input-medium">
                        <div class="input-group">
                            <span class="input-group-addon">
                                <input type="checkbox" name="rule.use_virtual_currency" id="ruleUseVirtualCurrency" value="1" <#if rule.use_virtual_currency??>${rule.use_virtual_currency?string('checked', '')}</#if>>
                            </span>
                            <input type="text" class="form-control" name="rule.virtual_currency" id="ruleVirtualCurrency" value="${rule.virtual_currency!}">
                            <span class="input-group-addon">
                                元
                            </span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="begin_time">开始时间: <span class="mandatory">*</span></label>
                <div class="col-sm-9">
                    <div class="input-group input-medium date  form_datetime" data-link-field="begin_time">
                        <input class="form-control" size="16" type="text" value="${rule.begin_time!}" name="rule.begin_time" id="begin_time">
                        <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                        <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
                    </div>
                    <input type="hidden" id="rule.begin_time" name="begin_time" value="" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="end_time">结束时间: <span class="mandatory">*</span></label>
                <div class="col-sm-9">
                    <div class="input-group input-medium date  form_datetime" data-link-field="end_time">
                        <input class="form-control" size="16" type="text" value="${rule.end_time!}" name="rule.end_time" id="end_time">
                        <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                        <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
                    </div>
                    <input type="hidden" id="rule.end_time" name="end_time" value="" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="rule.consume">中奖数字集合: </label>
                <div class="col-sm-4">
                    <input type="text" class="form-control" name="rule.winning_numbers" id="rule.winning_numbers" value="${rule.winning_numbers!}">
                    多个请用 "," 号隔开
                </div>
            </div>
        </div>

        <div class="form-actions text-right">
            <a class="btn default yellow-stripe" href="${ctx}/admin/game/rule">返回</a>
            <input type="submit" value="保存" class="btn btn-primary">
        </div>
    </div>
    </div>
</form>
</@override>

<@override name="viewmodule">rule_item</@override>

<@extends name="../../_basic/main.ftl"></@extends>
